/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/*package filedown;*/


/**
 *
 * @author JEET
 */

/* Imports java.io package classes. */


import java.io.*;

/* Imports java.rmi package classes. */ 

import java.rmi.*;
/*
class FileServer - Creates the RMI server that registers all the remote objects.
Method:
main() -
 Starts the RMI server and registers the remote objects. */  


public class FileServer 
{
   
       public static void main(String args[]) 
   {
     
    	   if(System.getSecurityManager() == null) {
    	         System.setSecurityManager(new RMISecurityManager());
    	      }
    	      try {
    	         FileRemote fi = new FileRemoteImpl("FileServer");
    	         Naming.rebind("//127.0.0.1/FileServer", fi);

      
            System.out.println("Object is registered.");
       
            System.out.println("Now server is waiting for client request");
      
        }
    
        catch(Exception e) 
     
        {
        
           e.printStackTrace();
      
           System.out.println("FileServer: " + e);
      }
   }
}


